﻿using System;
using System.Collections.Generic;
using System.Linq;
using InvestmentIntelligence.DbModel.Models;

namespace InvestmentIntelligence.Data.Repository
{
    public interface IEntityRepository
    {
        /// <summary>
        ///     AddUser new entity
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        int Add(Entity entity);

        /// <summary>
        ///     RemoveUser entity By theirs ID
        /// </summary>
        /// <param name="entityId"></param>
        void Remove(int entityId);

        /// <summary>
        ///     Get List Of All entities
        /// </summary>
        /// <returns></returns>
        List<T> GetList<T>(Func<IQueryable<Entity>, IEnumerable<T>> f);

        /// <summary>
        ///     Get entity by theirs ID
        /// </summary>
        /// <param name="entityId"></param>
        /// <returns></returns>
        Entity Get(int entityId);

        /// <summary>
        ///     Update entity
        /// </summary>
        /// <param name="entity"></param>
        void Update(Entity entity);

        /// <summary>
        ///     Return list of entity users
        /// </summary>
        /// <param name="entityId"></param>
        /// <returns></returns>
        List<T> GetUserList<T>(Func<IQueryable<User>, IEnumerable<T>> f, int entityId);
    }
}